/*
This file is part of BORG.

    BORG is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    BORG is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with BORG; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Copyright 2003 by Mike Berger
*/
/*
 * helpscrn.java
 *
 * Created on October 5, 2003, 8:55 AM
 */

package net.sf.borg.ui;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JMenuBar;

import net.sf.borg.common.PrefName;


/**
 *
 * @author  mberger
 */
// helpscrn just displays an HTML page in a window
class HelpScreen extends DockableView {
    


    /** Creates new form helpscrn */
    private String title_ = "";
    HelpScreen(String file, String title) {
	title_ = title;
        initComponents();
        try {
            jEditorPane1.setPage(getClass().getResource(file));
        } catch (java.io.IOException e1) {
            e1.printStackTrace();
        }
      
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents()//GEN-BEGIN:initComponents
    {
	setLayout(new GridBagLayout());
        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = new javax.swing.JEditorPane();       
        jEditorPane1.setEditable(false);
        //jEditorPane1.setPreferredSize(new java.awt.Dimension(1280, 1024));
        jScrollPane1.setViewportView(jEditorPane1);
        GridBagConstraints cons = new GridBagConstraints();
        cons.weightx = 1.0;
        cons.weighty = 1.0;
        cons.fill = GridBagConstraints.BOTH;
        add(jScrollPane1,cons);


    }//GEN-END:initComponents
    
 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
    /* (non-Javadoc)
     * @see net.sf.borg.ui.View#refresh()
     */
    public void refresh() {
        
    }


    public PrefName getFrameSizePref() {
	return PrefName.HELPVIEWSIZE;
    }


    public String getFrameTitle() {
	return title_;
    }


    public JMenuBar getMenuForFrame() {
	// TODO Auto-generated method stub
	return null;
    }
    
} 
